package is.olsenolsen;
//
public class Bless {
	//
	public Bless(){
		// T�mur klasasmi�ur.
	}
	//
	public static void killApp(boolean killSafely) { 
        if (killSafely) { 
            /* 
             * Eftirfarandi stef er fengi� af netinu, samkv�mt
             * eftirfarandi vefsl�� (birt � tveimum l�num):
             * http://stackoverflow.com/questions/2092951/
             * how-to-close-android-application
             * 
             * -    -    -    -    -    -    -    -    -    -    -    -
             * 
             * Gefa merki til st�rikerfisins um a� enda og safna �ll atri�i af
             * keyrzluforritinu og l�ta forriti� h�tta keyrzlu (��dd lauslega
             * �r heimas��unni, �a�an sem �etta stef var fengi�)
             */ 
            System.runFinalizersOnExit(true); 
            /* 
             * Force the system to close the app down completely instead of 
             * retaining it in the background. The virtual machine that runs the 
             * app will be killed. The app will be completely created as a new 
             * app in a new virtual machine running in a new process if the user 
             * starts the app again.
             * 
             *  
             * F� kerfi� til �ess a� sl�kkva � keyrzlunni � sta� �ess a� forriti�
             * s� a� �fram � keyrzlu � bakgrunninum (��dd lauslega
             * �r heimas��unni, sem fyrr segir)
             */ 
            System.exit(0); 
        } else { 
            /* 
             *  Til vara er forriti� l�ti� h�tta �n �ess a� vista �ll
             *  nau�synleg atri�i e�a l�ta enda hugsanlegum a�ger�um
             *  (��dd lauslega �r heimas��unni, sem fyrr segir)
             */ 
            android.os.Process.killProcess(android.os.Process.myPid()); 
        } // if (killSafely) else . . .
 
    } // public static void killApp( . . . ).
	//
} // public class Bless
